package ch.cyberduck.binding.foundation;

/*
 * Copyright (c) 2002-2009 David Kocher. All rights reserved.
 *
 * http://cyberduck.ch/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * Bug fixes, suggestions and comments should be sent to:
 * dkocher@cyberduck.ch
 */

import org.rococoa.ID;
import org.rococoa.ObjCClass;
import org.rococoa.Rococoa;
import org.rococoa.Selector;

/**
 * This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
 * a tool written by <a href="http://ochafik.free.fr/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
 * For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a>, <a href="http://rococoa.dev.java.net/">Rococoa</a>, or <a href="http://jna.dev.java.net/">JNA</a>.
 */
public abstract class NSAppleEventManager extends NSObject {
    private static final _Class CLASS = Rococoa.createClass("NSAppleEventManager", _Class.class);

    public interface _Class extends ObjCClass {
        /**
         * Get the pointer to the program's single NSAppleEventManager.<br>
         * Original signature : <code>+(NSAppleEventManager*)sharedAppleEventManager</code><br>
         * <i>native declaration : line 30</i>
         */
        NSAppleEventManager sharedAppleEventManager();
    }

    /**
     * Get the pointer to the program's single NSAppleEventManager.<br>
     * Original signature : <code>+(NSAppleEventManager*)sharedAppleEventManager</code><br>
     * <i>native declaration : line 30</i>
     */
    public static NSAppleEventManager sharedAppleEventManager() {
        return CLASS.sharedAppleEventManager();
    }

    /**
     * <i>native declaration : line 35</i><br>
     * Conversion Error : /**<br>
     * * When it is invoked, the value of the first parameter will be the event to be handled.  The value of the second parameter will be the reply event to fill in.  A reply event object will always be passed in (replyEvent will never be nil), but it should not be touched if the event sender has not requested a reply, which is indicated by [replyEvent descriptorType]==typeNull.<br>
     * * Original signature : <code>-(void)setEventHandler:(id) andSelector:(SEL) forEventClass:() andEventID:()</code><br>
     * * /<br>
     */
    public abstract void setEventHandler_andSelector_forEventClass_andEventID(ID handler, Selector selector, int eventClass, int eventID);
    /**
     * <i>native declaration : line 36</i><br>
     * Conversion Error : /// Original signature : <code>-(void)removeEventHandlerForEventClass:() andEventID:()</code><br>
     * - (void)removeEventHandlerForEventClass:(null)eventClass andEventID:(null)eventID; (Argument eventClass cannot be converted)
     */
    /**
     * <i>native declaration : line 40</i><br>
     * Conversion Error : /**<br>
     *  * This method is primarily meant for Cocoa's internal use.  It does not send events to other applications!<br>
     *  * Original signature : <code>-(id)dispatchRawAppleEvent:(const AppleEvent*) withRawReply:(AppleEvent*) handlerRefCon:()</code><br>
     *  * /<br>
     * - dispatchRawAppleEvent:(const AppleEvent*)theAppleEvent withRawReply:(AppleEvent*)theReply handlerRefCon:(null)handlerRefCon; (Argument handlerRefCon cannot be converted)
     */
    /**
     * If an Apple event is being handled on the current thread (i.e., a handler that was registered with -setEventHandler:andSelector:forEventClass:andEventID: is being messaged at this instant or -setCurrentAppleEventAndReplyEventWithSuspensionID: has just been invoked), return the descriptor for the event.  Return nil otherwise.  The effects of mutating or retaining the returned descriptor are undefined, though it may be copied.<br>
     * Original signature : <code>-(NSAppleEventDescriptor*)currentAppleEvent</code><br>
     * <i>native declaration : line 45</i>
     */
    public abstract NSAppleEventDescriptor currentAppleEvent();

    /**
     * If an Apple event is being handled on the current thread (i.e., -currentAppleEvent would not return nil), return the corresponding reply event descriptor.  Return nil otherwise.  This descriptor, including any mutatations, will be returned to the sender of the current event when all handling of the event has been completed, if the sender has requested a reply.  The effects of retaining the descriptor are undefined; it may be copied, but mutations of the copy will not be returned to the sender of the current event.<br>
     * Original signature : <code>-(NSAppleEventDescriptor*)currentReplyAppleEvent</code><br>
     * <i>native declaration : line 48</i>
     */
    public abstract NSAppleEventDescriptor currentReplyAppleEvent();

    /**
     * If an Apple event is being handled on the current thread (i.e., -currentAppleEvent would not return nil), suspend the handling of the event, returning an ID that must be used to resume the handling of the event.  Return zero otherwise.  The suspended event will no longer be the current event after this method has returned.<br>
     * Original signature : <code>-(NSAppleEventManagerSuspensionID)suspendCurrentAppleEvent</code><br>
     * <i>native declaration : line 51</i>
     */
    public abstract com.sun.jna.Pointer suspendCurrentAppleEvent();

    /**
     * Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, return the descriptor for the event whose handling was suspended.  The effects of mutating or retaining the returned descriptor are undefined, though it may be copied.  This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.<br>
     * Original signature : <code>-(NSAppleEventDescriptor*)appleEventForSuspensionID:(NSAppleEventManagerSuspensionID)</code><br>
     * <i>native declaration : line 54</i>
     */
    public abstract NSAppleEventDescriptor appleEventForSuspensionID(com.sun.jna.Pointer suspensionID);

    /**
     * Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, return the corresponding reply event descriptor.  This descriptor, including any mutatations, will be returned to the sender of the suspended event when handling of the event is resumed, if the sender has requested a reply.  The effects of retaining the descriptor are undefined; it may be copied, but mutations of the copy will not be returned to the sender of the suspended event.  This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.<br>
     * Original signature : <code>-(NSAppleEventDescriptor*)replyAppleEventForSuspensionID:(NSAppleEventManagerSuspensionID)</code><br>
     * <i>native declaration : line 57</i>
     */
    public abstract NSAppleEventDescriptor replyAppleEventForSuspensionID(com.sun.jna.Pointer suspensionID);

    /**
     * Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, set the values that will be returned by subsequent invocations of -currentAppleEvent and -currentReplyAppleEvent to be the event whose handling was suspended and its corresponding reply event, respectively.  Redundant invocations of this method will be ignored.<br>
     * Original signature : <code>-(void)setCurrentAppleEventAndReplyEventWithSuspensionID:(NSAppleEventManagerSuspensionID)</code><br>
     * <i>native declaration : line 60</i>
     */
    public abstract void setCurrentAppleEventAndReplyEventWithSuspensionID(com.sun.jna.Pointer suspensionID);

    /**
     * Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, signal that handling of the suspended event may now continue.  This may result in the immediate sending of the reply event to the sender of the suspended event, if the sender has requested a reply.  If the suspension ID has been used in a previous invocation of -setCurrentAppleEventAndReplyEventWithSuspensionID: the effects of that invocation will be completely undone.  Subsequent invocations of other NSAppleEventManager methods using the same suspension ID are invalid.  This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.<br>
     * Original signature : <code>-(void)resumeWithSuspensionID:(NSAppleEventManagerSuspensionID)</code><br>
     * <i>native declaration : line 63</i>
     */
    public abstract void resumeWithSuspensionID(com.sun.jna.Pointer suspensionID);
}
